package logger;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;

import DTGenerators.DTGenerator;

public class Log {
	
	private String propsPath="/props/log4j.properties";
	private Logger log;
	final static Properties prop = new Properties();
	
	InputStream in;


	public Log(Class<?> cl) throws IOException {
		log = Logger.getLogger(cl);
		in = DTGenerator.class.getResourceAsStream(propsPath);
		prop.load(in);
		PropertyConfigurator.configure(prop);
	}
	
	public void trace(String trace){
		log.trace(trace);
	}
	
	public void info(String info){
		log.info(info);
	}
	
	public void debug(String debug){
		log.debug(debug);
	}
	
	public void warn(String warn){
		log.warn(warn);
	}
	
	public void error(String error){
		log.error(error);
	}
	
	public void fatal(String fatal){
		log.fatal(fatal);
	}
}
